<?php
$query = "SELECT `ipiresia`.`id`, `ipiresia`.`perigrafi`, `ipiresia`.`timi`, `ipiresia`.`katigoria`, `ipiresia`.`energi`
	FROM `ipiresia` WHERE `ipiresia`.`energi`=1  
	ORDER BY `ipiresia`.`id` ASC";

mysqli_set_charset(Globals::$db, "utf8");
$result = mysqli_query(Globals::$db, $query);
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {

	echo "ipiresies.push(new ipiresia(" . 
		$row['id'] . "," .
		"'" . $row['perigrafi'] . "', " .
		$row['timi'] . ", " .
		$row['katigoria'] .
		")); \n";

}
echo "\n";
mysqli_free_result($result);
?>
